package com.smartwebx.ha.dal.assign.dao;

import java.util.Collection;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.smartwebx.ha.dal.usebean.StationAdminArea;

@CacheNamespace
public interface HaAdminAreaMapper {
	@Select("select id,name,level,parentId,0 statType from ha_admin_area")
	public Collection<StationAdminArea> findAll();
	
	@Select("select id,name,level,parentId,0 statType from ha_admin_area where name = #{admauth}")
	public Collection<StationAdminArea> findAllWhere(@Param("admauth") String admauth);

	@Select("select id,name,level,parentId,0 statType from ha_admin_area where id = #{parentId}")
	public StationAdminArea findByParentId(@Param("parentId") String parentId);
	
	@Insert("INSERT INTO ha_admin_area(id,name,level,parentId) VALUES(#{id},"
            + "#{name},#{level},#{parentId})")
	public void insert(StationAdminArea adminArea);
}